﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NTQOnlineExam.Services.Models
{
    public class BasketDTO
    {
        public Guid BasketId { get; set; }
        public string UserName { get; set; }
        public DateTime? CreationDate { get; set; }
        public string Comment { get; set; }
        public decimal? PaymentFee { get; set; }
        public decimal? PaymentTaxFee { get; set; }
        public IList<BasketItemDTO> BasketItems { get; set; }

        public decimal GetTotalProductPrice()
        {
            return BasketItems.Sum(item => item.Price);
        }

        public decimal GetTotalPrice()
        {
            return GetTotalProductPrice() + (PaymentFee ?? 0);
        }
    }
}
